package com.zkh360.service.message.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.zkh360.service.message.domain.SysAuthorities;
import com.zkh360.service.message.mybatis.BaseMapper;

/**
 * Created by chuanxi.zhao on 18-1-19.
 */
@Mapper
public interface AuthoritiesMapper extends BaseMapper<SysAuthorities> {

	/**
	 *
	 *
	 * @param username
	 * @return
	 */
	public List<String> loadUserAuthoritiesByName(String username);

	/**
	 * 根据用户获取权限信息
	 * 
	 * @param sysUsers
	 *            用户属性
	 * @return 权限信息
	 */
	public List<SysAuthorities> getAuthoritiesByUser(@Param("user_id") Long user_id,
			@Param("user_account") String user_account);

	/**
	 * 根据资源ID和权限状态查询权限信息
	 *  
	 * @param resourceId  资源ID
	 * @param enabled     角色状态
	 * @return 
	 */
	public List<SysAuthorities> getAuthorityByResourceId(@Param("resourceId") Integer resourceId, @Param("enabled") Integer enabled);
	
	/**
	 * 根据角色获取权限信息
	 * 
	 * @param role_id 角色ID
	 * @return 权限信息
	 */
	public List<SysAuthorities> getAuthoritiesByRole(@Param("roleId") Long role_id);
}
